<?php
class HomeModel extends Model{
	public $id;
	public $userid;
	
	public function __construct($id){
		$this->id=$id;
		$this->getid();
	}
	
	private function getid(){
		$id = $Model = M()->query('SELECT UserId FROM users WHERE UserId='.$this->id);
		return $id[0];
	}
	
	public function getDetailInfo(){
		$list = M()->query('SELECT EduLevel,SchoolNumber,Gender,BirthDate,EnterSchoolDate,GraduateDate,College,MajorCate,MajorName,MSN,QQ,Fetion,PostalCode,Address,FixedPhone,PersonalIntroduce FROM student WHERE UserId='.$this->id);
		return $list[0];
	}
	
	public function getMajorCate(){
		$list = M()->query('SELECT Id,Name FROM majorcate');
		return $list;
	}
	
}